/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.InternalStructures;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.Kernel.Property;
import edu.pku.sei.modeler.model.uml.Kernel.Property;

import edu.pku.sei.modeler.model.uml.Kernel.Classifier;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class StructuredClassifier extends Classifier implements IStructuredClassifier {
	// attributes
	
	
	
	
	// references
	
	protected MetaTypedList role;
	
	protected MetaTypedList ownedConnector;
	
	protected MetaTypedList ownedAttribute;
	
	protected MetaTypedList part;
	
	
	
	// getters & setters for attributes
	
	// getters for references
	
	public MetaTypedList getRole() {
		if(role == null) {
			role = new MetaTypedList(ConnectableElement.class, this, ModelPackage.STRUCTUREDCLASSIFIER_ROLE);
		}
		return role;
	}
	
	public MetaTypedList getOwnedConnector() {
		if(ownedConnector == null) {
			ownedConnector = new MetaTypedList(Connector.class, this, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDCONNECTOR);
		}
		return ownedConnector;
	}
	
	public MetaTypedList getOwnedAttribute() {
		if(ownedAttribute == null) {
			ownedAttribute = new MetaTypedList(Property.class, this, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDATTRIBUTE);
		}
		return ownedAttribute;
	}
	
	public MetaTypedList getPart() {
		if(part == null) {
			part = new MetaTypedList(Property.class, this, ModelPackage.STRUCTUREDCLASSIFIER_PART);
		}
		return part;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		// references
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.STRUCTUREDCLASSIFIER_ROLE, role);		
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDCONNECTOR, ownedConnector);
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDATTRIBUTE, ownedAttribute);
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.STRUCTUREDCLASSIFIER_PART, part);		
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		// references
		
		this.getRole().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.STRUCTUREDCLASSIFIER_ROLE, this));
		
		this.getOwnedConnector().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDCONNECTOR));
		
		this.getOwnedAttribute().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.STRUCTUREDCLASSIFIER_OWNEDATTRIBUTE));
		
		this.getPart().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.STRUCTUREDCLASSIFIER_PART, this));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else if(ModelPackage.STRUCTUREDCLASSIFIER_ROLE.equals(featureID)) {
			getRole().add(value);
		}
		
		else if(ModelPackage.STRUCTUREDCLASSIFIER_PART.equals(featureID)) {
			getPart().add(value);
		}
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 